package com.sibu.yx.promotion.persistence.vo;

import java.io.Serializable;
import java.util.List;

import com.doubo.common.constants.CommonConstants;
import com.doubo.common.model.request.common.CommonRequest;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author suzheng
 * @date 2020-06-17
 **/
@EqualsAndHashCode(callSuper = true)
@Data
public class ExportInfoVo<T> extends CommonRequest implements Serializable {
    private static final long serialVersionUID = -2013871710341290844L;
    /**
     * dataList 数据列表
     */
    private List<T> dataList;

    /**
     * beanName bean名称
     */
    private String beanName;

    private String sheetName = "Sheet1";

    private Class<T> dataClass;

    /**
     * 导出文件的名称
     */
    private String outFileName;


    @Override
    public String toString() {
        String dataListTemp = null;
        if (getDataList() != null) {
            if (getDataList().size() <= CommonConstants.MAX_LOG_DATA_SIZE) {
                dataListTemp = getDataList().toString();
            } else {
                dataListTemp = "...";
            }
        }
        return "ExportInfo(dataList=" + dataListTemp + ", outFileName=" + getOutFileName() + ", beanName=" + getBeanName() + ";";
    }

}
